package com.ruoyi.merchant.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.merchant.mapper.DeviceModelMapper;
import com.ruoyi.merchant.domain.DeviceModel;
import com.ruoyi.merchant.service.IDeviceModelService;

/**
 * 设备型号Service业务层处理
 * 
 * @author chengxin.ju
 * @date 2023-12-12
 */
@Service
public class DeviceModelServiceImpl implements IDeviceModelService 
{
    @Autowired
    private DeviceModelMapper deviceModelMapper;

    /**
     * 查询设备型号
     * 
     * @param id 设备型号主键
     * @return 设备型号
     */
    @Override
    public DeviceModel selectDeviceModelById(String id)
    {
        return deviceModelMapper.selectDeviceModelById(id);
    }

    /**
     * 查询设备型号列表
     * 
     * @param deviceModel 设备型号
     * @return 设备型号
     */
    @Override
    public List<DeviceModel> selectDeviceModelList(DeviceModel deviceModel)
    {
        return deviceModelMapper.selectDeviceModelList(deviceModel);
    }

    /**
     * 新增设备型号
     * 
     * @param deviceModel 设备型号
     * @return 结果
     */
    @Override
    public int insertDeviceModel(DeviceModel deviceModel)
    {
        deviceModel.setCreateTime(DateUtils.getNowDate());
        return deviceModelMapper.insertDeviceModel(deviceModel);
    }

    /**
     * 修改设备型号
     * 
     * @param deviceModel 设备型号
     * @return 结果
     */
    @Override
    public int updateDeviceModel(DeviceModel deviceModel)
    {
        return deviceModelMapper.updateDeviceModel(deviceModel);
    }

    /**
     * 批量删除设备型号
     * 
     * @param ids 需要删除的设备型号主键
     * @return 结果
     */
    @Override
    public int deleteDeviceModelByIds(String[] ids)
    {
        return deviceModelMapper.deleteDeviceModelByIds(ids);
    }

    /**
     * 删除设备型号信息
     * 
     * @param id 设备型号主键
     * @return 结果
     */
    @Override
    public int deleteDeviceModelById(String id)
    {
        return deviceModelMapper.deleteDeviceModelById(id);
    }
}
